
#ifndef _TTG_PIPELINE_BINDING_
#define _TTG_PIPELINE_BINDING_

#include "InternalBinding.h"

namespace ttg
{
	namespace pipeline
	{
		template <class InType, class OutType>
		class Binding :public ttg_internal::pipeline::Binding<InType, OutType,
															  InType, OutType>
		{
			protected:
				//Hiding context.
				virtual void onBegin(ttg::pipeline::ContextID ID)
				{ onBegin(); }
				//Hiding context.
				virtual void process(ttg::pipeline::ContextID ID, InType data)
				{ process(data); }
				//Hiding context.
				virtual void onEnd(ttg::pipeline::ContextID ID)
				{ onEnd(); }
			public:
				//Notifies about start of processing.
				virtual void onBegin()
				{ /*nothing*/ }
				//Processes data.
				virtual void process(InType data) = 0;
				//Notifies about end of processing.
				virtual void onEnd()
				{ /*nothing*/ }
				//Creates binding to target device.
				inline Binding(ttg::devices::LogicalDevice target_device)
					:ttg_internal::pipeline::Binding<InType, OutType, InType, OutType>(target_device)
				{ /*nothing*/ }
		};
	}
}

#endif
